package com.bytezreo.template;

import java.util.Calendar;
import java.util.Scanner;

/**
 * 
 * @Description    抽象类 练习
 * @author Bytezero·zhenglei!        Email:420498246@qq.com
 * @version
 * @date 下午2:50:49
 * @
 *
 */
public class PayrollSystem {

	public static void main(String[] args) {
		
		//方式一：
//		Scanner scanner = new Scanner(System.in);
//		System.out.println("请输入当月的月份：");
//		int month = scanner.nextInt();
		
		//方式二
		Calendar calendar = Calendar.getInstance();
		int month =calendar.get(Calendar.MONTH); //获取当前的月份
		System.out.println(month+1); //一月份 0
		
		
		
		
		Employee[] emps = new Employee[2];
		
		emps[0] = new SalariedEmployee("Tom", 1002, new MyDate(2000, 3, 15),10000);
		emps[1] = new HourlyEmployee("jery", 2001, new MyDate(2001,10, 17),60,240);
	
		for(int i =0; i <emps.length;i++) {
			System.out.println(emps[i]);
			
			 double salary =emps[i].earnings();
			 System.out.println("月工资为：" + salary);
			 
			 if((month+1) == emps[i].getBirthady().getMonth()) {
				 System.out.println("生日快乐！奖励100元");
			 }
			 
			 
		}
	
	}
}
